package com.springmvc.controller;

import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

@Controller
public class ViewController {
	
	@RequestMapping("/view")
	public ModelAndView view(HttpServletRequest request){		
		String path = request.getParameter("path");
		
		String contextPath = request.getContextPath();
		System.out.println(contextPath);
		ModelAndView mav = new ModelAndView();
		mav.setViewName("index");
		mav.addObject("contextPath",contextPath);
		return mav;	
	}
}
